<?php


$path = dirname(dirname(__FILE__));
require($path.'/lib/crt.php');

$crt = new CRT();
$crt->init();

$minX = Clean::float($_REQUEST['minX']);
$maxX = Clean::float($_REQUEST['maxX']);
$minY = Clean::float($_REQUEST['minY']);
$maxY = Clean::float($_REQUEST['maxY']);
//$layer = Clean::string($_REQUEST['layer']);
//$metroId = Clean::int($_REQUEST['metroId']);

//require_once(PLUGIN_PATH.'/lib/markets.php');

$db = DBs::getGISDB();

$sql = "SELECT name1, x,y FROM ".LABELS_TBL. " 
WHERE x between $maxX and $minX and y between $minY and $maxY";
$res = $db->GetArray($sql);
echo json_encode($res);

?>
